Class sjl.Not1
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sjl.Not1

java.lang.Object
   |
   +----sjl.Not1

public class Not1
extends Object
implements Predicate1
A predicate adapter. The Not1 class can wrap a Predicate1 class so that the truth value is reversed.
    public class IsGreen implements Predicate1 {
        public boolean compare(Object car) {
            return ((Car)car).color = "Green";
        }
    }
    Algo.find(list.begin(), list.end(), new Not1(new IsGreen()));
The above example will return a iterator to the first car that is not green.

Copyright © 1996 Finn Bock


Constructor Index

 o Not1(Predicate1)
Specified the predicate to use.

Method Index

 o compare(Object)
Negate the thruth value of the predicate.

Constructors

 o Not1
  public Not1(Predicate1 pred)
Specified the predicate to use.

Methods

 o compare
  public boolean compare(Object o)
Negate the thruth value of the predicate. The predicate is specified when the adapter is constructed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index